#!/usr/bin/python
# -*- coding: UTF-8 -*-
from types import NoneType


def toString(s):
    if type(s) is NoneType:
        return ""
    elif isinstance(s, unicode):
        return s.encode('utf-8')
    else:
        return s